package com.test.java;

import java.util.Arrays;
import java.util.Scanner;

/**
 * 给定一个正整数数列，和正整数p，设这个数列中的最大值是M，最小值是m，如果M <= m * p，则称这个数列是完美数列。
 * =============================================================
 * Version          Author          Date            Description
 * 1.0              白建         2017/12/26             创建
 * =============================================================
 */
public class Java_21
{

    public static void main(String[] args)
    {

        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int P = scanner.nextInt();
        long[] list = new long[N];
        int length = 0;

        for (int i = 0; i < N; i++)
        {
            list[i] = scanner.nextLong();
        }

        Arrays.sort(list);

        //todo:下面这个算法思路很好，效率很高
        for (int i = 0; i < N; i++)
        {
            for (int j = i + length; j < N; j++)
            {
                if (list[j] > list[i] * P)
                {
                    break;
                }
                length++;
            }
        }
        System.out.println(length);
    }
}
